<%@ page import="java.util.Vector" %>
<%@ page import="java.util.Collections" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/4/22
  Time: 22:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>购物车</title>
</head>
<body>
<%
    request.setCharacterEncoding("UTF-8");
    String username1 = (String) session.getAttribute("userName1");
    Vector goods = (Vector) session.getAttribute("shoppingCart");
    if (goods == null)
        goods = new Vector();
    String[] g = request.getParameterValues("choice");
    if (g != null) {
      Collections.addAll(goods, g);
    }
    session.setAttribute("shoppingCart", goods);
    out.println("<br>您的性名：" + username1);
    out.println("<br>购物车中的商品：<br>");
    for (int j = 0; j < goods.size(); j++)
        out.print(goods.get(j) + "<br>");
%>
<p><a href="main.jsp">返回主页面继续购物</a></p>
</body>
</html>
